<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <title>Title</title>
    <style>
        body{
            margin: 0;
        }
        .pg-header{
            background-color: cadetblue;
            height: 48px;;
        }
        .pg-menu{
            position: absolute;
            background-color: gray;
            top: 48px;
            left: 0;
            bottom: 0;
            width: 200px;
        }
        .pg-content{
            position: absolute;     /*使用absolute，只用改变overflow就可以切换两种模式*/
            background-color: blueviolet;
            top: 48px;
            right: 0;
            left: 200px;
            bottom: 0;
            min-width: 900px;   /* 设置最小宽度，当页面宽度小于900px时，出现滚动条*/
            overflow: auto; /* 当有overflow时，左侧菜单固定（常用方式），当没有overflow时，左侧菜单随着滑轮滚动而移动*/
        }
    </style>


</head>
<body>

<div class="pg-header"></div>
<div class="pg-body">
    <div class="pg-menu">a</div>
    <div class="pg-content">
        <div style="background-color: blueviolet">      <!--此处style，当没有overflow时，内容部分都有背景色-->
            <p style="margin: 0">adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
            <p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p><p>adfaf</p>
        </div>
    </div>
</div>
<div class="pg-booter"></div>

</body>
</html>